From ebda736a09bc96650cfbb3612d2a83b3454a542e Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 12 Nov 2020 16:04:30 +0000 Subject: [PATCH] a11y: Mark SearchEntry icons as presentational While the "clear the search entry" icon behaves like a button, we don't have any actual action that can trigger it, so let's ignore it. --- gtk/gtksearchentry.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gtk/gtksearchentry.c b/gtk/gtksearchentry.c index c3662a0e1c..86338ee3b4 100644 --- a/gtk/gtksearchentry.c +++ b/gtk/gtksearchentry.c @@ -554,8 +554,9 @@ gtk_search_entry_init (GtkSearchEntry *entry) GtkWidget *icon; GtkGesture *press; + /* The search icon is purely presentational */ icon = g_object_new (GTK_TYPE_IMAGE, - "accessible-role", GTK_ACCESSIBLE_ROLE_NONE, + "accessible-role", GTK_ACCESSIBLE_ROLE_PRESENTATION, "icon-name", "system-search-symbolic", NULL); gtk_widget_set_parent (icon, GTK_WIDGET (entry)); @@ -570,7 +571,10 @@ gtk_search_entry_init (GtkSearchEntry *entry) g_signal_connect (entry->entry, "notify", G_CALLBACK (notify_cb), entry); g_signal_connect (entry->entry, "activate", G_CALLBACK (activate_cb), entry); - entry->icon = gtk_image_new_from_icon_name ("edit-clear-symbolic"); + entry->icon = g_object_new (GTK_TYPE_IMAGE, + "accessible-role", GTK_ACCESSIBLE_ROLE_PRESENTATION, + "icon-name", "edit-clear-symbolic", + NULL); gtk_widget_set_tooltip_text (entry->icon, _("Clear entry")); gtk_widget_set_parent (entry->icon, GTK_WIDGET (entry)); gtk_widget_set_child_visible (entry->icon, FALSE); -- 2.30.2